<html>
<head>
    <title>SilverNibbles</title>
    <meta name="keywords" content="SilverNibbles, Microsoft, Silverlight, Game, Snake, Nibbles, .NET, Open Source, Mark Heath" />
    <meta name="description" content="SilverNibbles is an open source snake game in Silverlight based on Microsoft QBASIC Nibbles." />
    <style type="text/css">
        body { font-family: Tahoma,Arial,Sans-Serif; }
        #SilverlightControlHost { width: 640px; height: 460px; }
    </style>
    
    <script type="text/javascript">
    function onNewGameClick(players) {
        var silverlightControl = document.getElementById('SilverlightControl');
        if(silverlightControl)
        {
           silverlightControl.Content.SilverNibbles.NewGame(players);
           silverlightControl.focus();
        }
    }

    function onInitialSpeedChanged() {
       var silverlightControl = document.getElementById('SilverlightControl');
       var speedCombo = document.getElementById('InitialSpeedCombo');
       var index = speedCombo.selectedIndex;
       silverlightControl.Content.SilverNibbles.StartingSpeed = parseInt(speedCombo.options[index].value,10);
       silverlightControl.focus();
    }

	// Give the keyboard focus to the Silverlight control by default
    function bodyOnLoad() {
      var silverlightControl = document.getElementById('SilverlightControl');
      if (silverlightControl) {
          silverlightControl.focus();          
      }
    }
    
    </script>       
</head>

<body onload="bodyOnLoad()">

<h3>SilverNibbles - A Silverlight Snake Game</h3>

<p>By <a href="http://mark-dot-net.blogspot.com/">Mark Heath</a>. 
Source code available at <a href="http://nibbles.codeplex.com">http://nibbles.codeplex.com</a>.
Font used is "Teen bold" from <a href="http://www.larabiefonts.com/index.html">Larabie Fonts</a></p>

<div id="SilverlightControlHost"">
	<object data="data:application/x-silverlight," 
	type="application/x-silverlight-2"
	id="SilverlightControl" name="SilverlightControl" width="100%" height="100%">
		<param name="source" value="ClientBin/SilverNibbles.xap"/>
		<param name="background" value="white" />
		<param name="minRuntimeVersion" value="3.0.40624.0" />
		<param name="autoUpgrade" value="true" />
		
		  <a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=3.0.40624.0" style="text-decoration:none">
 			  <img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight" style="border-style:none"/>
		  </a>
	</object>
	<iframe style='visibility:hidden;height:0;width:0;border:0px'></iframe>
</div>

<!--
Removed due to FireFox keyboard focus issues -->
<p>n.b. If you are using FireFox, you may need to click on the game above for it to
accept keyboard input.</p>
        
<p>New game: <input type="button" onclick="onNewGameClick(1)" value="One Player" />
<input type="button" onclick="onNewGameClick(2)" value="Two Players" /></p>

<p>Initial speed: <select id="InitialSpeedCombo" onchange="onInitialSpeedChanged()">
<option value="1">1 - Very Slow</option>
<option value="2">2 - </option>
<option value="3">3 - Beginner</option>
<option value="4">4 - </option>
<option selected="selected" value="5">5 - Normal</option>
<option value="6">6 - </option>
<option value="7">7 - Fast</option>
<option value="8">8 - </option>
<option value="9">9 - Very Fast</option>
<option value="10">10 - Twiddle-fingers</option>

</select> </p>
<p>Sammy Keys: J=Left, K=Down, L=Right, I=Up <br />
Jake Keys: A=Left, S=Down, D=Right, W=Up<br />
Press Escape to Pause.</p>


<script type="text/javascript"><!--
google_ad_client = "pub-4583197049167294";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_ad_type = "text_image";
google_ad_channel = "";
//-->
</script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>        

</body>
</html>
